package org.cuit.seon.core.context;

import org.apache.commons.lang3.StringUtils;

public class TokenCache {

    private String token;

    public void set(String value) {
        if (StringUtils.isBlank(value)) {
            throw new RuntimeException("token的值不能为空");
        }
        token = value;
    }

    public String get() {
        return token;
    }

    public void remove(String oldToken) {
        if (oldToken.equals(token)) {
            token = null;
        }
    }
}
